const actions = {
    addCart({commit},params){
        //用setTimeout模拟一个异步加载的获取
        setTimeout(()=>{
            let result = 'ok'
            if(result == 'ok'){
                commit('addCart',params)  
            }    
        },300)             
    },
    subtract({commit},params){
        setTimeout(()=>{
            let result = 'ok'
            if(result == 'ok'){
                commit('subtract',params);
            }   
        } ,300)
    },
    augment({commit},params){
        setTimeout(()=>{
            let result = 'ok'
            if(result == 'ok'){
                commit('augment',params);
            }   
        } ,300)
    }
}
export default actions